package com.codeczx.completeuidemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class RVInSVActivity extends AppCompatActivity {

    @BindView(R.id.rv_vertical)
    RecyclerView rvVertical;

    RVCommonAdapter adapter;
    @BindView(R.id.rv_horizontal)
    RecyclerView rvHorizontal;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rvin_sv);
        ButterKnife.bind(this);
        List<String> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(i + "");
        }
        adapter = new RVCommonAdapter(list);
        rvVertical.setAdapter(adapter);
        rvVertical.setLayoutManager(new LinearLayoutManager(this));
        rvVertical.setNestedScrollingEnabled(false);

        rvHorizontal.setAdapter(adapter);
        rvHorizontal.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false));
    }
}
